﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Asd.MP.AppService.Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        body
        {
            background-color: #f1f8fa;
            font-size: 12px;
        }
        .main
        {
            background-color: White;
            width: 700px;
            margin: 5px auto;
        }
        /*表格*/
        table
        {
            border-collapse: collapse;
            border-spacing: 0; /*设置空单元格是否显示边框empty-cells:show|hide*/
        }
        td
        {
            font-size: 12px;
        }
        .blue_table
        {
            border: 1px solid #a2cae1; /* float:left; width:100%; */
            margin-top: 9px;
            margin-bottom: 10px;
        }
        .blue_table tr
        {
            border-bottom: 1px dashed #dcebf4;
        }
        .blue_table tr th
        {
            font-weight: normal;
            line-height: 23px;
            background-color: #76c3e2;
            border-bottom: 1px solid #a2cae1;
        }
        .blue_table tr td
        {
            /*text-align:center; */
            line-height: 23px;
            padding: 2px;
        }
        .blue_table tr td a
        {
            color: #0286d5;
        }
        .blue_table tr td a:hover
        {
            text-decoration: underline;
        }
        .blue_table tr:hover
        {
            background-color: #fff8db;
        }
        .c1
        {
            background-color: #f1f8fa;
        }
        .blue_table tr td.w80
        {
            width: 76px;
        }
        .blue_table tr td.w150
        {
            width: 146px;
        }
        .blue_table tr td.w120
        {
            width: 116px;
        }
    </style>
    <script src="jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="Loading.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("table tbody tr :button").click(function () {
                var tds = $(this).parents("tbody,tr").find("td");
                var endpoint = $.trim(tds.eq(1).text());
                var method = $.trim(tds.eq(2).text());
                //AddressBook.svc/AddressBookList
                //PlatformWork.svc/DoWork
                $.get("PlatformWork.svc/DoWork", { endpoint: endpoint, method: method, rnd: Math.random() }, function (result) {
                    $("#result").html(result);
                }, "text");
            });
        });
    </script>
</head>
<body>
    <div class="main">
        <table class="blue_table" width="100%">
            <thead>
                <tr>
                    <th>
                        服务名
                    </th>
                    <th>
                        地址
                    </th>
                    <th>
                        方法
                    </th>
                    <th>
                        调用
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        地址簿
                    </td>
                    <td>
                        http://localhost:5844/Services/AddressBook.svc
                    </td>
                    <td>
                        AddressBookList
                    </td>
                    <td>
                        <input type="button" value="调用" />
                    </td>
                </tr>
                <tr>
                    <td>
                        检查版本
                    </td>
                    <td>
                        http://localhost:5841/Services/CheckVersion.svc
                    </td>
                    <td>
                        Check
                    </td>
                    <td>
                        <input type="button" value="调用" />
                    </td>
                </tr>
            </tbody>
            <tfoot>
                <tr>
                    <th colspan="4">
                        结果窗口
                    </th>
                </tr>
                <tr>
                    <td colspan="4">
                        <div id="result">
                        </div>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</body>
</html>
